using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Text;
using DTO;

namespace DAO
{
    public class CT_PhieuThuePhongDAO
    {
        public void ThemChiTietPhieuThue(int MaPT, int MaKT)
        {
            try
            {
                SqlConnection con = new SqlConnection();
                DataProvider dp = new DataProvider();
                con = dp.ConnectionData();
                con.Open();

                SqlCommand cmd = con.CreateCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "sp_ThemChiTietPhieuThuePhong";

                cmd.Parameters.Add("@MaPT", SqlDbType.Int);
                cmd.Parameters.Add("@MaKT", SqlDbType.Int);

                cmd.Parameters["@MaPT"].Value = MaPT;
                cmd.Parameters["@MaKT"].Value = MaKT;

                cmd.ExecuteNonQuery();

                con.Close();
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }
    }
}
